package org.edu.modules.stu.biye.service.impl;

import org.edu.common.base.BasePageDto;
import org.edu.common.base.BaseServiceImpl;
import org.edu.common.utils.ConvertUtils;
import org.edu.common.base.BaseServiceImpl;
import org.edu.modules.stu.biye.mapper.VeStuGraduationYxbysMapper;
import org.edu.modules.stu.biye.entity.VeStuGraduationYxbys;
import org.edu.modules.stu.biye.dto.VeStuGraduationYxbysDto;
import org.edu.modules.stu.biye.service.VeStuGraduationYxbysService;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



/**
 * 实现类
 */
@Service
public class VeStuGraduationYxbysServiceImpl extends BaseServiceImpl<VeStuGraduationYxbys, VeStuGraduationYxbysMapper> implements VeStuGraduationYxbysService {

    public IPage<VeStuGraduationYxbysDto> pageDto(BasePageDto page, @Param(Constants.WRAPPER) Wrapper queryWrapper){
        return mapper.pageDto(page,queryWrapper);
    }
    /**
    * 查询实体类
    */
    public VeStuGraduationYxbysDto findDtoById(String id) {
        VeStuGraduationYxbys entity = super.findById(id);
        VeStuGraduationYxbysDto dto = ConvertUtils.convertToDto(entity, VeStuGraduationYxbysDto.class);
        return dto;
    }

    /**
    * 新增或者修改
    */
    public void insertOrUpdate(VeStuGraduationYxbysDto dto,Boolean isAdd){
        if(isAdd){
            super.insert(dto);
        }else{
            super.update(dto);
        }
    }

    @Override
    public void importExcel(List<Map<String, Object>> mapList){
        for (Map map: mapList) {
            VeStuGraduationYxbysDto dto = new VeStuGraduationYxbysDto();
                   //         dto.setGraduatId ((String)map.get(0000));
                   //         dto.setRemark ((String)map.get(0000));
            
            super.insert(dto);
        }

    }

}
